<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns="http://matsadaml.org/msds/v1.0"
	xmlns:msds="http://matsadaml.org/msds/v1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	exclude-result-prefixes="msds">
	<xsl:output method="xml" version="1.0" encoding="UTF-8"
		indent="yes" />
	<xsl:strip-space elements="*" />
	<xsl:param name="ProductId">
		P123-6789
	</xsl:param>
	<xsl:param name="Name">
		6789
	</xsl:param>
	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>
	<xsl:template match="msds:product/@id">
		<xsl:attribute name="id">
			<xsl:value-of select="normalize-space($ProductId)" />
		</xsl:attribute>
	</xsl:template>
	<xsl:template match="msds:text/text()">
		<xsl:value-of select="normalize-space(.)"/>
	</xsl:template>
	<xsl:template match="msds:name[@countries = 'SE; ' and @lang = 'sv']/node()">
		<xsl:value-of select="normalize-space(concat('Produkt ', $Name))"/>
	</xsl:template>
	<xsl:template match="msds:name[@countries = 'NO; ' and @lang = 'no']/text()">
		<xsl:value-of select="normalize-space(concat('Produkt ', $Name))"/>
	</xsl:template>
	<xsl:template match="msds:name[@countries = 'UK; ' and @lang = 'en']/text()">
		<xsl:value-of select="normalize-space(concat('Product ', $Name))"/>
	</xsl:template>
</xsl:stylesheet>
